package day1031.demo04;

/**
 * @program: qy158
 * @description:
 * @author: 闫克起2
 * @create: 2022-10-31 10:50
 **/
public class Boy implements Runnable {
    private BankCard bankCard;
    public Boy(BankCard bankCard){
         this.bankCard=bankCard;
    }
    @Override
    public void run() {
       for (int i=0;i<10;i++){
           bankCard.setBalance(bankCard.getBalance()+1000);
           System.out.println(Thread.currentThread().getName()+"向卡中存入1000,卡中余额:"+bankCard.getBalance());
       }
    }
}
